import { createRouter, createWebHistory } from 'vue-router'
import Login from '@/views/login/index.vue'
import Register from '@/views/register/index.vue'
import Reportlist from '@/views/reportlist/index.vue'
import Selectdate from '@/views/selectdate/index.vue'
import Setmeal from '@/views/setmeal/index.vue'
import Report from '@/views/report/index.vue'
import Persional from '@/views/personal/index.vue'
import Hospital from '@/views/hospital/index.vue'
import Confirmorder from '@/views/Confirmorder/index.vue'
import Appointmentsuccess from '@/views/Appointmentsuccess/index.vue'
import Appointmentlist from '@/views/Appointmentlist/index.vue'
import Appointmentcancel from '@/views/Appointmentcancel/index.vue'
import Appointment from '@/views/Appointment/index.vue'
import Index from '@/views/index/index.vue'
import UpdateVerify from '@/views/updatePassword/updatePassword.vue'
import UpdateIndex from '@/views/updatePassword/index.vue'
import AI from '../views/AI/AI.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Index',
      component: Login
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/index',
      name: '首页',
      component: Index
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/reportlist',
      name: '报告列表',
      component: Reportlist
    },
    {
      path: '/selectdate',
      name: 'selectdate',
      component: Selectdate
    },
    {
      path: '/setmeal',
      name: 'stemeal',
      component: Setmeal
    },
    {
      path: '/report',
      name: '报告',
      component: Report
    },
    {
      path: '/personal',
      name: '个人中心',
      component: Persional
    },
    {
      path: '/hospital',
      name: '医院',
      component: Hospital
    },
    {
      path: '/confirmorder',
      name: 'confirmorder',
      component: Confirmorder
    },
    {
      path: '/appointmentsuccess',
      name: '预约成功',
      component: Appointmentsuccess
    },
    {
      path: '/appointmentlist',
      name: '预约列表',
      component: Appointmentlist
    },
    {
      path: '/appointmentcancel',
      name: '取消预约',
      component: Appointmentcancel
    },
    {
      path: '/appointment',
      name: '预约',
      component: Appointment
    },
    {
      path: '/updateVerify',
      name: '修改密码验证',
      component: UpdateVerify
    },
    {
      path: '/updateIndex',
      name: '修改密码',
      component: UpdateIndex
    }, 
    {
      path: '/ai',
      name: 'AI问诊',
      component: AI
    }
  ]
})
// 重置路由
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
